package com.piece.mall.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "sms_seckill_sku_notice")
@ApiModel(value = "秒杀商品通知订阅")
public class SmsSeckillSkuNotice implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", length = 11)
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "member_id")
    @ApiModelProperty(value = "会员主键")
    private Long memberId;

    @Column(name = "sku_id")
    @ApiModelProperty(value = "sku主键")
    private Long skuId;

    @Column(name = "session_id")
    @ApiModelProperty(value = "活动场次主键")
    private Long sessionId;

    @Column(name = "subcribe_time")
    @ApiModelProperty(value = "订阅时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date subcribeTime;

    @Column(name = "send_time")
    @ApiModelProperty(value = "发送时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date sendTime;

    @Column(name = "notice_type")
    @ApiModelProperty(value = "通知方式", notes = "0=短信, 1=邮件")
    private String noticeType;
}
